<!DOCTYPE html>
<html lang="en"><head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>联想商城 - 购物车</title>
    
    <link href="/home/shopCar_files/common.css" type="text/css" rel="stylesheet">
    <link href="/home/shopCar_files/buycart.css" type="text/css" rel="stylesheet">
    <script src="/home/shopCar_files/jquery-1.js"></script>


    <script src="/home/shopCar_files/a"></script>

    <script type="text/javascript">
        var ssoassetModule = "http://m1.lefile.cn";
    </script>
    <link href="/home/shopCar_files/headb.css" type="text/css" rel="stylesheet">
    <style>
        /* ===================alert============================ */
        .alert {position:fixed; border:3px solid #f60;  left:50%; top:40%; background:#fff; box-shadow:3px 3px 8px rgba(0,0,0,0.5); text-align:center; display:none;z-index:10000}
        .alert img,.alert span { vertical-align:middle;}
        .alert_body {padding:30px;}
    </style>
</head>
<body class="ns_body">


<div class="top_box">
    <div class="top_cont">

        <div class="top_login_r top_red">
        
        </div>
        @if(!session('master')['email'])
        <ul class="top_login top_red">
<<<<<<< HEAD

            <li id="headorderID_a" style="">
                <a href="">我的订单</a>
            </li>

=======
                    <!-- <li><a href="#">18101020964</a></li> -->
            <li class="top_loginbtn" ><a href="javascript:;" class="login" latag="latag_pc_common_header_login">登录</a></li>
            <li class="top_regist"><a href="javascript:;" class="regist1" latag="latag_pc_common_header_register">注册</a></li>
>>>>>>> dd9709a60749a6b346bc1abd319f1422077e67db
        </ul>
        @endif

<<<<<<< HEAD
        @if(!session('master')['email'])
        <ul class="top_login top_red">
                    <!-- <li><a href="#">18101020964</a></li> -->
            <li class="top_loginbtn" ><a href="javascript:;" class="login" latag="latag_pc_common_header_login">登录</a></li>
            <li class="top_regist"><a href="javascript:;" class="regist" latag="latag_pc_common_header_register">注册</a></li>
        </ul>
        @endif

        @if(session('master')['email'])
        
        <div class="top_phone top_username" style="">
            <div class="top_phone_title"><span class="gotomycenter">{{ session('master')['email'] }}</span><a href="javascript:void(0)" class="top_usepng top_downs"></a></div>
            <ul style="display: none;">
                <li><a href="{{ url('/home/user/detail') }}">我的商城</a></li>
                <li class=>
                <a href="/home/quit" class="" latag="latag_pc_common_header_logout">退出登录</a>
                </li>
=======
        @if(session('master')['email'])
        
        <div class="top_phone top_username" style="">
            <div class="top_phone_title">
            <span class="gotomycenter">{{ session('master')['email'] }}</span>
            <a href="javascript:void(0)" class="top_usepng top_downs"></a>
            
            </div>
            <ul style="display: none;">
                <li><a href="{{ url('/home/address') }}">我的商城</a></li>
                <li class=>
                <a href="/home/quit" class="" latag="latag_pc_common_header_logout">退出登录</a>
                </li>
                
>>>>>>> dd9709a60749a6b346bc1abd319f1422077e67db
            </ul>
        </div>
        @endif

        <ul class="top_login top_red">
            <!-- <li><a href="#">18101020964</a></li> -->
            <li style="border-left:none;"><a href="{{ url('home/index') }}">返回首页</a></li>
        </ul>


    </div>
</div>
<!-- ----------------===============     logo     ===============--------------- -->
<div class="top_logob">
    <img src="/home/shopCar_files/pic-13.jpg" class="top_logob_imga">
    <img src="/home/shopCar_files/pic-12.jpg" class="top_logob_imgb">
</div>

<script type="text/javascript">

    $(function(){
        var ticket = "e40e7004-4c8a-4963-8564-31271a8337d8";
        
        navTopDown();
        
        
        passport.init({
        ticket: ticket,
        drawUserInfo: function(){
            $("#UserNameID").text(passport.cookie.loginName);
            $("#UserNameID").show();
            $("#headorderID_a").show();
            $("#RegisterID").hide();
            $("#LoginID").hide();
            $("#LogOutID").show();
            $("#UserInfo").show();
        },
        logout:function(){
            $("#UserNameID").text('');
            $("#UserNameID").hide();
            $("#headorderID_a").hide();
            $("#UserInfo").hide();
            $("#RegisterID").show();
            $("#LoginID").show();
            $("#LogOutID").hide();
        },
        loginRedirect:window.location.href
        })
        
        $('body').delegate('.login','click',function(){
            passport.show();
        }).delegate('.logout','click',function(){
            passport.doLogout();
        }).delegate('.regist','click',function(){
            passport.hide();
            regist.init(ticket);
        }).delegate('.forgetPwd','click',function(){
            passport.hide();
            recover.init(ticket);
        })
        
        var ssoReload = $('body').attr('ssoReload');
        if(ssoReload != undefined && ssoReload != null && ssoReload == "0"){
            passport.loginRedirect = false;
            
        }
        
        
        
    })
    function navTopDown(){
        $('.top_title').bind('mouseenter',function(){
            $(this).siblings('ul').stop(true,true).slideDown(300);
            $(this).find('a').removeClass('.top_down').addClass('top_up');
        });
        $('.top_link').bind('mouseleave',function(){
            $(this).find('ul').stop(true,true).slideUp(300);
            $(this).find('.top_title').find('a').removeClass('top_up').addClass('top_down');
        });


        $('.top_phone_title').bind('mouseenter',function(){
            $(this).siblings('ul').stop(true,true).slideDown(300);
            $(this).find('a').removeClass('.top_downs').addClass('top_ups');
        });
        $('.top_phone').bind('mouseleave',function(){
            $(this).find('ul').stop(true,true).slideUp(300);
            $(this).find('.top_phone_title').find('a').removeClass('top_ups').addClass('top_downs');
        });


    };




</script> 
<div class="buycart w1200">
<div id="cart_main"><div class="bc_option clearfix">
    <div class="bc_all clearfix active"><a href="javascript:;" id="chooseall"></a>
    <input type='checkbox' class='allchoice'>
    <span id="choice">全选</span>
    </div>
</div>
<div class="bc_table" id="main_table">


    <table cellspacing="0" cellpadding="0">
            <tbody>
              <tr>
                <th colspan="3" width="462">商品</th>
                
                <th width="152">单价</th>
                <th width="152">数量</th>
                <th width="152">金额</th>
                <th width="117">操作</th>
              </tr>
            </tbody>
    </table>
<form action="/home/order/center" method='post'>

{{ csrf_field() }}
                    
@foreach($data as $v)

    <table cellspacing="0" cellpadding="0">
        
        <!--带服务-->
        <tbody><tr class=" active" gcode="" stock="">
                <td class="bc_table_sel" width="57">

                    <input type='checkbox' class='checkbox' name='id[]' value="{{ $v -> id }}">  

                </td>
                <td class="bc_table_img" width="148">
                    <a href="" target="_blank"><img src="{{ url('uploads/goods_pic') }}/{{ $v -> logo }}" style="width:100px;height:100px"></a>
                    <div class="bc_zhezhao"></div>
                </td>
                <td class="bc_proname bc_name_gift" width="257">
                    <a href="" target="_blank">{{ $v -> goods_name }}</a>
                    <div class="bc_service"><a href="javascript:;" class="bc_add choose_service"><img src="/home/shopCar_files/lenovo_icon.jpg">&nbsp;购买联想服务</a>
                </div>
                </td>
                
                <td class='price' style="position:relative;" width="152">
                    <span >{{ $v -> goods_price }}</span>
                    <!--满减-->
                </td>
                <td width="152">

                    <label class="i_box clearfix">
                        <input class="subtract" value="-"  type="button">
                        <input class="num" value="1" name='goods_number' id='cartNum' cartId='{{ $v -> id }}' style="ime-mode: disabled;" type="text">
                        <input class="add" value="+" type="button">
                    </label>
            
                </td>
                <td width="152" class="totalMoney" ></td>
                <td style="text-align:left" width="117">
                    <a href="/home/shopCar/delete/{{ $v -> id }}" style="color: #000" title="删除">删除</a>
                    <br>
                        
                    
                </td>
            </tr>
    </tbody></table>
    @endforeach
    <script type="text/javascript">

    window.onload = function()
    {

        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
             }
        });
        var num = $('.num').val(); 

        //判断是否循环过总价
        var isloop = true;

        //获取id
        var id = $('#cartNum').attr('cartId');

        $('.num').each(function(i, e)
        {
            var num = parseFloat($('.num').eq(i).val());
            changePrice(num, $('.num').eq(i));
            changeAll();
        });

        $('.checkbox').click(function()
            {
                //当点击时再次循环计算总价
                isloop = true;
                changeAll();
            });
         //点击加号加一
        $('.add').on('click', function(){

            var t =  $(this).parent().find(".num");

            var num = t.val();

            num ++;

            t.val(num);
            // alert();
            changePrice(num, $(this));

            changeNum(id, num);

            //当点击时再次循环计算总价
            isloop = true;
            changeAll();
            
        });

        //点击减号减一
        $('.subtract').on('click', function(){
            var t =  $(this).parent().find(".num");

            var num = t.val();

            num --;

            if(num < 1)
            {
                return false;
            }
            else
            {
                t.val(num);

                changePrice(num, $(this));

                changeNum(id, num);

                //当点击时再次循环计算总价
                isloop = true;
                changeAll();
            }

        });

        function changeNum(id, num)
        {
            $.ajax({
                type:'POST',
                url:"{{ url('/home/shopCar/ajaxUpdate') }}",
                data:{id:id,num:num},
            });

        }

        //获取每件商品总额
        function changePrice(num, th)
        {
            var price = parseFloat(th.eq(0).parents('td').siblings('.price').children().eq(0).html());

            //总价=数量*单价
            var totalMoney = price * num;

            th.eq(0).parents('td').siblings('.totalMoney').html(totalMoney.toFixed(2));

        }

        //改变所有商品总额
        function changeAll()
        {
            if($('.checkbox').is(':checked') && isloop)
            {
                var all = 0;
                $('.checkbox:checked').each(function(i, e)
                {
                    var price = parseFloat($(this).eq(0).parents('td').siblings('.price').children().eq(0).html());
                    var num = parseInt($(this).eq(0).parents('td').siblings().eq(4).children().children('.num').val());

                    //总价=数量*单价
                    all += price * num;

                });
                    $('.all').html(parseFloat(all.toFixed(2)));

                    isloop = false;
            }else if(!$('.checkbox').is(':checked') && isloop)
            {
                $('.all').html('0.00');
            }
            
            // $('.all').html(price);
        }

        $('.pay').css('cursor', 'pointer');

         $('.allchoice').css('cursor', 'pointer');

        //实现全选
        // var checkbox = $('.checkbox');

        $('.allchoice').eq(0).on('click', function()
        {
            var state = $('.allchoice').eq(0).is(':checked');
            $('.checkbox').attr('checked', state);
            $('.allchoice').eq(1).attr('checked', state);
            //当点击时再次循环计算总价
            isloop = true;
            changeAll();

        });
         $('.allchoice').eq(1).on('click', function()
        {
            var state = $('.allchoice').eq(1).is(':checked');
            $('.checkbox').attr('checked', state);
            $('.allchoice').eq(0).attr('checked', state);
            //当点击时再次循环计算总价
            isloop = true;
            changeAll();
        });
    }



    </script>

</div>
<div class="bc_num clearfix">
    <div class="bc_num_fl">
        <div class="bc_all clearfix active"><a href="javascript:;"></a>
        <input type='checkbox' class="allchoice">
        <span>全选</span></div>
        <a href="javascript:;" class="bc_num_del">删除选中商品</a>
    </div>
    <ul class="bc_num_fr">
        <li style="margin-top:0;">商品总价：<span class = 'all'>0.00</span>元</li>
        <li>优惠节省：0.00 元</li>
        <li class="bc_red totalMoney">合计：<span  class = "all" id="totalmoneyf">0.00</span>元</li>
    </ul>
</div>
<div class="bc_probtn clearfix">

    <input type="image" class='pay' src='/home/img/pay.jpg' style="float:right">

</form>
</div>
</div>
</div>


<script type="text/html" id="servicetr">
    <tr class="bc_gift">
        <td colspan="8">
            <div class="bc_gift_con">
                
                <ul class="bc_gift_top clearfix" ccode="" gcode="">
                    <li class="bc_top_title"></li>
                    <li class="bc_top_price"></li>
                    <li class="bc_top_num"></li>
                    <li class="bc_top_red"></li>
                    <li class="bc_top_del">
                        <a href="javascript:;" style="color: #000" title="删除" onclick="deleservice(this)" >删除</a>
                                            <br/>
                       
                                        </li>
                </ul>
               
            </div>
        </td>
    </tr>
</script>


<script type="text/html" id="serviceul">
   
    <ul class="bc_gift_top clearfix" ccode="" gcode="">
        <li class="bc_top_title"></li>
        <li class="bc_top_price"></li>
        <li class="bc_top_num"></li>
        <li class="bc_top_red"></li>
        <li class="bc_top_del">
        <a href="javascript:;" style="color: #000" title="删除" onclick="deleservice(this)" latag="">删除</a>
        </li>
    </ul>
  
</script>


<script type="text/html" id="serviceplain">
    
    <div ccode="" gcode=""></div>
   
</script>
    <div id="foot_div">
    
<!--服务列表-->

<div id="Services-list" class="ns_Services-list ns_fixClear">

    <div class="ns_w">
        <img class="lazy_img" src="/home/shopCar_files/CmBZEFZz7I-ADJipAABALgU8YUw364.jpg" width="1200" height="83">
        <ul>
            <li class="ns_services-1">官方品质保障 <em>the official quality guarantee</em></li>
            <li class="ns_services-2">1对1客户式服务<em>one-to-one customer</em></li>
            <li class="ns_services-3">个性化定制服务<em>personalized customer service</em></li>
            <li class="ns_services-4">全场免费速递<em>full free delivery</em></li>
            <li class="ns_services-5">无忧完美服务<em>perfect customer service</em></li>
            <li class="ns_services-6">精美专利包装<em>patent packaging</em></li>
            <li class="ns_services-7">新品抢先体验<em>new experience</em></li>
        </ul>
    </div>
    
</div>
<!--服务列表-->
<!--页脚-->
<div id="footer">
    <div class="ns_p2">
        <div class="ns_w ns_fixClear">
            <dl>
                <dt> <a>购物指南 </a></dt>
                <dd> <a target="_blank" href="">服务商信息</a> <a target="_blank" href="">购买流程</a> <a target="_blank" href="">注册登录</a></dd>
            </dl>
            <dl>
                <dt> <a>配送方式</a></dt>
                <dd> <a target="_blank" href="">配送方式</a> <a target="_blank" href="">配送方式信息</a> <a target="_blank" href="">签收原则</a> <a target="_blank" href="">物流查询</a></dd>
            </dl>
            <dl>
                <dt> <a>支付方式  </a></dt>
                <dd> <a target="_blank" href="">支付方式</a> <a target="_blank" href="">支付问题</a><a target="_blank" href="">分期支付</a></dd>
            </dl>
            <dl>
                <dt> <a>订单信息  </a></dt>
                <dd> <a target="_blank" href="">订单信息</a> <a target="_blank" href="">其它频道订单发票</a><a target="_blank" href="">手机频道订单发票</a> </dd>
            </dl>
            <dl>
                <dt> <a>售后服务  </a></dt>
                <dd> <a target="_blank" href="">Lenovo频道商品售后</a><a target="_blank" href="">手机频道商品售后7天</a> <a target="_blank" href="">无理由退换货说明</a></dd>
            </dl>
            <dl style="padding-right:0;">
                <dt> <a>其他说明  </a></dt>
                <dd> <a target="_blank" href="">服务承诺</a> <a target="_blank" href="">账户安全</a>
                <a target="_blank" href="">产品安全</a>
                </dd>

                <ul class="ns_bank" id="ns_bank">
                    <span class="jt_top"></span>
                    <li><a href="" target="_blank">招商旗舰店</a></li>
                    <li><a href="" target="_blank">中信旗舰店</a></li>
                    <li><a style="border-bottom:0;" href="" target="_blank">工行旗舰店</a></li>
                </ul>
            </dl>
        </div>
    </div>

</div>

<div class="ns_box">
    <div class="ns_p4 ns_fixClear">
        <div class="ns_w">
          <div class="ns_footer_line"><a href="" title="关于联想" target="_blank">关于联想</a><span>|</span>
            <a href="" title="联系我们" target="_blank">联系我们</a><span>|</span>
            <a href="" title="工作机会" target="_blank">工作机会</a><span>|</span>
            <a href="" title="新闻中心" target="_blank">新闻中心</a><span style="display:none;">|</span>
            <a href="#" style="display:none;" title="商城移动版" target="_blank">商城移动版</a><span>|</span>
            <a href="" title="聚享汇会员专享" target="_blank">聚享汇会员专享</a><span>|</span>            
            <a href="" title="联想社区" target="_blank">联想社区</a><span>|</span>
            <a href="" title="NBD" target="_blank">NBD</a><span>|</span>
            <a href="" title=" 销售网点" target="_blank"><em class="usepng icon_addr1"></em>销售网点</a><span>|</span><a href="" title=" 服务网点" target="_blank"><em class="usepng icon_addr2"></em>服务网点</a></div>
          <div class="ns_footer_line">版权所有：1998-2016 联想集团<span>|</span><a href="" title="法律公告" target="_blank">法律公告</a><span>|</span><a href="" title="隐私保护" target="_blank">隐私保护</a><span>|</span><a href="" target="_blank">京ICP备11035381</a><span>|</span><i style="font-style:normal;">京公网安备110108007970号</i><span>|</span><a href="" title="营业执照" target="_blank">营业执照：110000410127232</a></div>
        </div>
        <!--
        <div style="margin: 0 auto;width: 1200px;background: #f5f5f5;padding: 15px 0;">
            <span class="usepng foot_rz"></span>
             <img src="css/icon/renzheng.png" style="float:left;" width="100px">
            <div style="float:left;margin-left:10px;">
                <a style="text-decoration:none;color: rgb(102, 102, 102)" href="http://www.shopex.cn" target="_blank"><strong></strong></a> <br>
            </div>
        </div>
        -->
    </div>  
</div>
<!--页脚-->
</div>  
    <script type="text/javascript" src="/home/shopCar_files/template.js"></script>
    <script type="text/javascript" src="/home/shopCar_files/mylantern.js"></script>
    
    <script src="/home/shopCar_files/common.js" type="text/javascript"></script>
    <script src="/home/shopCar_files/buycart.js" type="text/javascript"></script>
    <script src="/home/shopCar_files/footer.js" type="text/javascript"></script>
    <script src="/home/shopCar_files/monitor.js" type="text/javascript"></script>



<script type="text/javascript" src="/home/shopCar_files/la.js"></script><div id="ppMask" class="ppMask"></div></body></html>